package com.anyonavinfo.cpaddemo.data.locationinfo.source;

import com.anyonavinfo.cpaddemo.data.locationinfo.LocationInfo;
import com.anyonavinfo.cpaddemo.data.locationinfo.source.remote.LocationInfoRemoteDataSource;

/**
 * Created by ZuiC on 2017/2/3.
 */

public class LocationInfoRepository implements LocationInfoDataSource{

    private static LocationInfoRepository INSTANCE = null;


    public static LocationInfoRepository getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new LocationInfoRepository();
        }
        return INSTANCE;
    }


    @Override
    public void getLocationInfo(double latitude, double longitude, final GetLocationInfoCallBack callBack) {
        LocationInfoRemoteDataSource.getInstance().getLocationInfo(latitude, longitude, new GetLocationInfoCallBack() {
            @Override
            public void onGetLocationInfo(LocationInfo locationInfo) {
                callBack.onGetLocationInfo(locationInfo);
            }
        });

    }
}
